import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
public class FileDemo15 {
    public static void main(String[] args) throws IOException {
        try(OutputStream outputStream = new FileOutputStream("test.txt")){
            String str = "hello world";
            outputStream.write(str.getBytes());
            outputStream.flush();
        }
    }
}
